//
//  VView.m
//  QuickReadComic
//
//  Created by 苗钧豪 on 16/9/2.
//  Copyright © 2016年 苗钧豪. All rights reserved.
//

#import "VView.h"
#import "VTableViewCell.h"
@implementation VView
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.tableview = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height) style:(UITableViewStylePlain)];
        _tableview.delegate = self;
        _tableview.dataSource = self;
        _tableview.estimatedRowHeight = 1000;
        _tableview.rowHeight = UITableViewAutomaticDimension;
        [_tableview registerNib:[UINib nibWithNibName:@"VTableViewCell" bundle:nil] forCellReuseIdentifier:@"VCell"];
        [self addSubview:_tableview];
    }
    return self;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 381;
//    return 1000;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    VTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"VCell" forIndexPath:indexPath];
    return cell;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
